package org.gap.domain;

import java.io.Serializable;

import java.lang.StringBuilder;

import java.util.Calendar;
import java.util.Set;

import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;

import javax.xml.bind.annotation.*;

import javax.persistence.*;

/**
 */

@Entity
@NamedQueries({
		@NamedQuery(name = "findAdressesByAddAdresse", query = "select myAdresses from Adresses myAdresses where myAdresses.addAdresse = ?1"),
		@NamedQuery(name = "findAdressesByAddBureauDistrib", query = "select myAdresses from Adresses myAdresses where myAdresses.addBureauDistrib = ?1"),
		@NamedQuery(name = "findAdressesByAddBureauDistribContaining", query = "select myAdresses from Adresses myAdresses where myAdresses.addBureauDistrib like ?1"),
		@NamedQuery(name = "findAdressesByAddDateCreation", query = "select myAdresses from Adresses myAdresses where myAdresses.addDateCreation = ?1"),
		@NamedQuery(name = "findAdressesByAddDateCreationAfter", query = "select myAdresses from Adresses myAdresses where myAdresses.addDateCreation > ?1"),
		@NamedQuery(name = "findAdressesByAddDateCreationBefore", query = "select myAdresses from Adresses myAdresses where myAdresses.addDateCreation < ?1"),
		@NamedQuery(name = "findAdressesByAddDateModification", query = "select myAdresses from Adresses myAdresses where myAdresses.addDateModification = ?1"),
		@NamedQuery(name = "findAdressesByAddDateModificationAfter", query = "select myAdresses from Adresses myAdresses where myAdresses.addDateModification > ?1"),
		@NamedQuery(name = "findAdressesByAddDateModificationBefore", query = "select myAdresses from Adresses myAdresses where myAdresses.addDateModification < ?1"),
		@NamedQuery(name = "findAdressesByAddLigne1", query = "select myAdresses from Adresses myAdresses where myAdresses.addLigne1 = ?1"),
		@NamedQuery(name = "findAdressesByAddLigne1Containing", query = "select myAdresses from Adresses myAdresses where myAdresses.addLigne1 like ?1"),
		@NamedQuery(name = "findAdressesByAddLigne2", query = "select myAdresses from Adresses myAdresses where myAdresses.addLigne2 = ?1"),
		@NamedQuery(name = "findAdressesByAddLigne2Containing", query = "select myAdresses from Adresses myAdresses where myAdresses.addLigne2 like ?1"),
		@NamedQuery(name = "findAdressesByAddLigne3", query = "select myAdresses from Adresses myAdresses where myAdresses.addLigne3 = ?1"),
		@NamedQuery(name = "findAdressesByAddLigne3Containing", query = "select myAdresses from Adresses myAdresses where myAdresses.addLigne3 like ?1"),
		@NamedQuery(name = "findAdressesByAddTopNpai", query = "select myAdresses from Adresses myAdresses where myAdresses.addTopNpai = ?1"),
		@NamedQuery(name = "findAdressesByAddTopNpaiContaining", query = "select myAdresses from Adresses myAdresses where myAdresses.addTopNpai like ?1"),
		@NamedQuery(name = "findAdressesByAddTypeVoie", query = "select myAdresses from Adresses myAdresses where myAdresses.addTypeVoie = ?1"),
		@NamedQuery(name = "findAdressesByAddTypeVoieContaining", query = "select myAdresses from Adresses myAdresses where myAdresses.addTypeVoie like ?1"),
		@NamedQuery(name = "findAdressesByPrimaryKey", query = "select myAdresses from Adresses myAdresses where myAdresses.addAdresse = ?1"),
		@NamedQuery(name = "findAllAdressess", query = "select myAdresses from Adresses myAdresses") })
@Table(schema = "GAP", name = "ADRESSES")
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(namespace = "GAP_v2/org/gap/domain", name = "Adresses")
public class Adresses implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 */

	@Column(name = "ADD_ADRESSE", nullable = false)
	@Basic(fetch = FetchType.EAGER)
	@Id
	@XmlElement
	Integer addAdresse;
	/**
	 */

	@Column(name = "ADD_TOP_NPAI", length = 1)
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String addTopNpai;
	/**
	 */

	@Column(name = "ADD_TYPE_VOIE", length = 20)
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String addTypeVoie;
	/**
	 */

	@Column(name = "ADD_LIGNE_1", length = 40)
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String addLigne1;
	/**
	 */

	@Column(name = "ADD_LIGNE_2", length = 40)
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String addLigne2;
	/**
	 */

	@Column(name = "ADD_LIGNE_3", length = 40)
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String addLigne3;
	/**
	 */

	@Column(name = "ADD_BUREAU_DISTRIB", length = 32)
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String addBureauDistrib;
	/**
	 */
	@Temporal(TemporalType.DATE)
	@Column(name = "ADD_DATE_CREATION")
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	Calendar addDateCreation;
	/**
	 */
	@Temporal(TemporalType.DATE)
	@Column(name = "ADD_DATE_MODIFICATION")
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	Calendar addDateModification;

	/**
	 */
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumns({ @JoinColumn(name = "ADD_USER_MODIFICATION", referencedColumnName = "USR_USER") })
	@XmlTransient
	Utilisateurs utilisateursByAddUserModification;
	/**
	 */
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumns({ @JoinColumn(name = "ADD_USER_CREATION", referencedColumnName = "USR_USER") })
	@XmlTransient
	Utilisateurs utilisateursByAddUserCreation;
	/**
	 */
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumns({
			@JoinColumn(name = "ADD_PAYS", referencedColumnName = "CDP_PAYS"),
			@JoinColumn(name = "ADD_CODE_POSTAL", referencedColumnName = "CDP_CODE_POSTAL"),
			@JoinColumn(name = "ADD_N_INSEE", referencedColumnName = "CDP_N_INSEE"),
			@JoinColumn(name = "ADD_VILLE", referencedColumnName = "CDP_LOCALITE") })
	@XmlTransient
	CodesPostaux codesPostaux;

	/**
	 */
	public void setAddAdresse(Integer addAdresse) {
		this.addAdresse = addAdresse;
	}

	/**
	 */
	public Integer getAddAdresse() {
		return this.addAdresse;
	}

	/**
	 */
	public void setAddTopNpai(String addTopNpai) {
		this.addTopNpai = addTopNpai;
	}

	/**
	 */
	public String getAddTopNpai() {
		return this.addTopNpai;
	}

	/**
	 */
	public void setAddTypeVoie(String addTypeVoie) {
		this.addTypeVoie = addTypeVoie;
	}

	/**
	 */
	public String getAddTypeVoie() {
		return this.addTypeVoie;
	}

	/**
	 */
	public void setAddLigne1(String addLigne1) {
		this.addLigne1 = addLigne1;
	}

	/**
	 */
	public String getAddLigne1() {
		return this.addLigne1;
	}

	/**
	 */
	public void setAddLigne2(String addLigne2) {
		this.addLigne2 = addLigne2;
	}

	/**
	 */
	public String getAddLigne2() {
		return this.addLigne2;
	}

	/**
	 */
	public void setAddLigne3(String addLigne3) {
		this.addLigne3 = addLigne3;
	}

	/**
	 */
	public String getAddLigne3() {
		return this.addLigne3;
	}

	/**
	 */
	public void setAddBureauDistrib(String addBureauDistrib) {
		this.addBureauDistrib = addBureauDistrib;
	}

	/**
	 */
	public String getAddBureauDistrib() {
		return this.addBureauDistrib;
	}

	/**
	 */
	public void setAddDateCreation(Calendar addDateCreation) {
		this.addDateCreation = addDateCreation;
	}

	/**
	 */
	public Calendar getAddDateCreation() {
		return this.addDateCreation;
	}

	/**
	 */
	public void setAddDateModification(Calendar addDateModification) {
		this.addDateModification = addDateModification;
	}

	/**
	 */
	public Calendar getAddDateModification() {
		return this.addDateModification;
	}

	/**
	 */
	public void setUtilisateursByAddUserModification(Utilisateurs utilisateursByAddUserModification) {
		this.utilisateursByAddUserModification = utilisateursByAddUserModification;
	}

	/**
	 */
	public Utilisateurs getUtilisateursByAddUserModification() {
		return utilisateursByAddUserModification;
	}

	/**
	 */
	public void setUtilisateursByAddUserCreation(Utilisateurs utilisateursByAddUserCreation) {
		this.utilisateursByAddUserCreation = utilisateursByAddUserCreation;
	}

	/**
	 */
	public Utilisateurs getUtilisateursByAddUserCreation() {
		return utilisateursByAddUserCreation;
	}

	/**
	 */
	public void setCodesPostaux(CodesPostaux codesPostaux) {
		this.codesPostaux = codesPostaux;
	}

	/**
	 */
	public CodesPostaux getCodesPostaux() {
		return codesPostaux;
	}

	/**
	 */
	public Adresses() {
	}

	/**
	 * Copies the contents of the specified bean into this bean.
	 *
	 */
	public void copy(Adresses that) {
		setAddAdresse(that.getAddAdresse());
		setAddTopNpai(that.getAddTopNpai());
		setAddTypeVoie(that.getAddTypeVoie());
		setAddLigne1(that.getAddLigne1());
		setAddLigne2(that.getAddLigne2());
		setAddLigne3(that.getAddLigne3());
		setAddBureauDistrib(that.getAddBureauDistrib());
		setAddDateCreation(that.getAddDateCreation());
		setAddDateModification(that.getAddDateModification());
		setUtilisateursByAddUserModification(that.getUtilisateursByAddUserModification());
		setUtilisateursByAddUserCreation(that.getUtilisateursByAddUserCreation());
		setCodesPostaux(that.getCodesPostaux());
	}

	/**
	 * Returns a textual representation of a bean.
	 *
	 */
	public String toString() {

		StringBuilder buffer = new StringBuilder();

		buffer.append("addAdresse=[").append(addAdresse).append("] ");
		buffer.append("addTopNpai=[").append(addTopNpai).append("] ");
		buffer.append("addTypeVoie=[").append(addTypeVoie).append("] ");
		buffer.append("addLigne1=[").append(addLigne1).append("] ");
		buffer.append("addLigne2=[").append(addLigne2).append("] ");
		buffer.append("addLigne3=[").append(addLigne3).append("] ");
		buffer.append("addBureauDistrib=[").append(addBureauDistrib).append("] ");
		buffer.append("addDateCreation=[").append(addDateCreation).append("] ");
		buffer.append("addDateModification=[").append(addDateModification).append("] ");

		return buffer.toString();
	}

	/**
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = (int) (prime * result + ((addAdresse == null) ? 0 : addAdresse.hashCode()));
		return result;
	}

	/**
	 */
	public boolean equals(Object obj) {
		if (obj == this)
			return true;
		if (!(obj instanceof Adresses))
			return false;
		Adresses equalCheck = (Adresses) obj;
		if ((addAdresse == null && equalCheck.addAdresse != null) || (addAdresse != null && equalCheck.addAdresse == null))
			return false;
		if (addAdresse != null && !addAdresse.equals(equalCheck.addAdresse))
			return false;
		return true;
	}
}
